<div ng-controller="archivescontroller">
	<div class="dropdown">
		<button class="btn btn-default dropdown-toggle" type="button" id="menu1" data-toggle="dropdown">Actions
		<span class="caret"></span></button>
		<ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
			<li role="presentation"><a role="menuitem" tabindex="-1" data-toggle="modal" href="#newArchive" ><span class="glyphicon glyphicon-plus-sign"></span> {{ Documents_NewArchive }} </a></li>
			<li role="presentation"><a role="menuitem" tabindex="-1" data-toggle="modal" href="#renameArchive" ><span class="glyphicon glyphicon-edit"></span> {{ Main_Rename }} </a></li>
			<li role="presentation" class="divider"></li>
			<li role="presentation"><a role="menuitem" tabindex="-1" ng-click="downloadArchiveCommand()" ><span class="glyphicon glyphicon-download"></span> {{ Main_Download }} </a></li>
			<li role="presentation"><a role="menuitem" tabindex="-1" data-toggle="modal" href="#uploadArchive" ><span class="glyphicon glyphicon-upload"></span> {{ Main_Uploadload }} </a></li>
			<li role="presentation" class="divider"></li>
			<li role="presentation"><a role="menuitem" tabindex="-1" data-toggle="modal" href="#confirmDeleteArchive" ><span class="glyphicon glyphicon-trash"></span> {{ Main_Delete }} </a></li>
		</ul>
	</div>
	<div class="pull-right">
		<div class="input-group">
			<input type="text" class="form-control" ng-model="archivesFilter" ng-change="filterClicked=true" placeholder="{{ Main_Filter }}" />
			<div class="input-group-btn">
				<button class="btn btn-default" type="submit" ng-click="getArchivesCommand()"><i class="glyphicon glyphicon-filter"></i></button>
				<button class="btn btn-default" type="submit" ng-show="filterClicked" ng-click="cancelFilterCommand()" ng-init="filterClicked=false;" ng-if="filterClicked"><i class="glyphicon glyphicon-remove"></i></button>
			</div>
		</div>
	</div>
	<img ng-show="loadingArchives" style="width:25px;height:25px" src="Resources/Pictures/ajax-loader.gif" />
	<div id="jqxArchivesTree" ng-show="canManageArchivesTree"></div>
	<div ng-include="'Partials/Admin/renamearchive.view.html'" ></div>
	<div ng-include="'Partials/Admin/confirmdeletearchive.view.html'" ></div>
	
	<div class="modal" id="newArchive">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">x</button>
					<h4 class="modal-title">{{ Documents_NewArchive }}</h4>
				</div>
				<div class="modal-body">
					<div class="container">
						<div class="row">
							<div class="col-sm-5">
								<div class="row form-group">
									<div class="col-xs-12">{{ Events_Reference }} <select class="form-control" data-ng-options="event.Id as event.Id + ' ' + event.Title + ' ' + event.StartDate for event in events" data-ng-model="eventReference"></select></div>
								</div>
								<div class="input-group">
									<input ng-model="createNewArchiveName" class="form-control" rows="5" placeholder="{{ Documents_NewArchiveName }}"/>
									<div class="input-group-btn">
										<button type="button" class="btn btn-primary" ng-click="createArchiveCommand()">
											<span class="glyphicon glyphicon-ok"></span>
										</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
			
				</div>
			</div>
		</div>
	</div>
	
	<div class="modal" id="renameArchive">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">x</button>
					<h4 class="modal-title">{{ selectedItem.label }}</h4>
				</div>
				<div class="modal-body">
					<div class="container">
						<div class="row">
							<div class="col-sm-5">
								<div class="input-group">
									<input ng-model="newArchiveName" class="form-control" rows="5" placeholder="{{ Documents_NewDocumentNameLabel }}"/>
									<div class="input-group-btn">
										<button type="button" class="btn btn-primary" ng-click="renameArchiveCommand()">
											<span class="glyphicon glyphicon-ok"></span> {{ Main_Validate }}
										</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
			
				</div>
			</div>
		</div>
	</div>
	
	<div class="modal" id="uploadArchive">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">x</button>
					<h4 class="modal-title">Répertoire cible : {{ selectedItem.path }}  </h4>
				</div>
				<div class="modal-body">
					<div class="container">
						<div class="row">
							<div class="col-sm-8">
								<form>
									<input ng-show="canUpload" type="file" id="file" name="file" onchange="angular.element(this).scope().uploadArchiveCommand(this.files)" multiple="true"/>
								</form>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<div style="margin-top: 10px; overflow: hidden;" id="jqxUploadArchiveProgressBar"></div>
				</div>
			</div>
		</div>
	</div>
	
</div>

<script>
	$(document).ready(function () {
	
		// Create jqxProgressBar.
		$("#jqxUploadArchiveProgressBar").jqxProgressBar({ width: 250, height: 25, value: 0 });
	});

</script>